From: Sebastian Wick Date: Wed, 24 Jul 2024 20:33:59 +0000 (+0200) Subject: lookingGlass: Make it possible to export the DebugControl service X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~226^2^2~19 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=a65e0722f1293e913ad3fda127b871cfcbfc7a84;p=gnome-shell.git lookingGlass: Make it possible to export the DebugControl service Mutter has a new tool for interacting with mutter with features we don't expose to users yet. It can be exported as a dbus service but it is not done so by default. This adds an easy way to do so without having to remember some JS snippet. Part-of: --- diff --git a/js/ui/lookingGlass.js b/js/ui/lookingGlass.js index ef40d7e5b..90b0f4a40 100644 --- a/js/ui/lookingGlass.js +++ b/js/ui/lookingGlass.js @@ -1222,6 +1222,25 @@ class UnsafeModeDebugFlag extends DebugFlag { } }); +const DebugControlExportedDebugFlag = GObject.registerClass( +class DebugControlExportedDebugFlag extends DebugFlag { + _init() { + super._init('debug-control'); + } + + _isEnabled() { + return global.context.get_debug_control().exported; + } + + _enable() { + global.context.get_debug_control().exported = true; + } + + _disable() { + global.context.get_debug_control().exported = false; + } +}); + const DebugFlags = GObject.registerClass( class DebugFlags extends St.BoxLayout { _init() { @@ -1251,9 +1270,12 @@ class DebugFlags extends St.BoxLayout { for (const flagName of this._getFlagNames(Meta.DebugTopic)) this.add_child(new MutterTopicDebugFlag(flagName)); + // General / Context + this._addHeader('General'); // MetaContext::unsafe-mode - this._addHeader('MetaContext'); this.add_child(new UnsafeModeDebugFlag()); + // DebugControl::exported + this.add_child(new DebugControlExportedDebugFlag()); } _addHeader(title) {